package priv.yiyuan.example.design.chain;

/**
 * 数据对象(上下文)
 *
 * @author YiYuan
 * @data 2025/10/14
 * @apoNote
 */
public class RawData {

    private String content;

    private boolean isValid = true;

    private String processingLog = "";

    public RawData(String content) {
        this.content = content;
    }

    public String getContent() {
        return content;
    }

    public boolean isValid() {
        return isValid;
    }

    public String getProcessingLog() {
        return processingLog;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public void setValid(boolean valid) {
        isValid = valid;
    }

    public void addProcessingLog(String log) {
        if (!this.processingLog.isEmpty()) {
            this.processingLog += " | ";
        }
        this.processingLog += log;
    }

    @Override
    public String toString() {
        return "原始数据 [内容: \"" + content + "\", 有效: " + isValid + ", 日志: " + processingLog + "]";
    }

}
